#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>
#include<time.h>

typedef int HDataType;

typedef struct Heap
{
	HDataType* a;
	int size;
	int capacity;
}Heap;

void HeapInit(Heap* php);
void HeapDestroy(Heap* php);

void AdjustUp(HDataType* a, int child);
void AdjustDown(int* a, int n, int parent);

void HeapPush(Heap* php, HDataType x);
void HeapPop(Heap* php);
bool HeapEmpty(Heap* php);
HDataType HeapTop(Heap* php);
void HeapSize(Heap* php);